home *** CD-ROM | disk | FTP | other *** search
/ Gigarom 1 / Gigarom Macintosh Archives (Quantum Leap)(CDRM1080320)(1993).iso / FILES / HYP / C-D / DeveloperStax.cpt / Developer Stack 1.0 / card_13724.txt < prev    next >
Text File  |  1989-02-26  |  5KB  |  213 lines

  1. -- card: 13724 from stack: in.0
  2. -- bmap block id: 0
  3. -- flags: 0000
  4. -- background id: 14090
  5. -- name: Self Naming Button
  6.  
  7.  
  8. -- part 1 (field)
  9. -- low flags: 00
  10. -- high flags: 0000
  11. -- rect: left=160 top=111 right=228 bottom=389
  12. -- title width / last selected line: 0
  13. -- icon id / first selected line: 0 / 0
  14. -- text alignment: 0
  15. -- font id: 3
  16. -- text size: 9
  17. -- style flags: 0
  18. -- line height: 12
  19. -- part name: 
  20.  
  21.  
  22. -- part 2 (button)
  23. -- low flags: 00
  24. -- high flags: A004
  25. -- rect: left=79 top=218 right=250 bottom=201
  26. -- title width / last selected line: 0
  27. -- icon id / first selected line: 0 / 0
  28. -- text alignment: 1
  29. -- font id: 0
  30. -- text size: 12
  31. -- style flags: 0
  32. -- line height: 16
  33. -- part name: Example 1
  34. ----- HyperTalk script -----
  35. on mouseUp
  36.   if the optionkey is down then
  37.     ask "what do you want to name this button?"
  38.     if it is empty then
  39.       beep
  40.     else
  41.       set the name of the target to it
  42.     end if
  43.   else
  44.     --
  45.     --your normal mouseup script goes in here
  46.     --
  47.   end if
  48. end mouseUp
  49.  
  50.  
  51.  
  52. -- part 8 (button)
  53. -- low flags: 00
  54. -- high flags: A000
  55. -- rect: left=79 top=256 right=288 bottom=201
  56. -- title width / last selected line: 0
  57. -- icon id / first selected line: 0 / 0
  58. -- text alignment: 1
  59. -- font id: 0
  60. -- text size: 12
  61. -- style flags: 0
  62. -- line height: 16
  63. -- part name: Example 1
  64. ----- HyperTalk script -----
  65. on mouseUp
  66.   if the optionkey is down then
  67.     ask "what do you want to name this button?"
  68.     if it is empty then
  69.       beep
  70.     else
  71.       set the name of the target to it
  72.     end if
  73.   else
  74.     --
  75.     --your normal mouseup script goes in here
  76.     --
  77.   end if
  78. end mouseUp
  79.  
  80.  
  81.  
  82. -- part 9 (button)
  83. -- low flags: 00
  84. -- high flags: A002
  85. -- rect: left=209 top=256 right=288 bottom=331
  86. -- title width / last selected line: 0
  87. -- icon id / first selected line: 0 / 0
  88. -- text alignment: 1
  89. -- font id: 0
  90. -- text size: 12
  91. -- style flags: 0
  92. -- line height: 16
  93. -- part name: Example 1
  94. ----- HyperTalk script -----
  95. on mouseUp
  96.   if the optionkey is down then
  97.     ask "what do you want to name this button?"
  98.     if it is empty then
  99.       beep
  100.     else
  101.       set the name of the target to it
  102.     end if
  103.   else
  104.     --
  105.     --your normal mouseup script goes in here
  106.     --
  107.   end if
  108. end mouseUp
  109.  
  110.  
  111.  
  112. -- part 10 (button)
  113. -- low flags: 00
  114. -- high flags: A006
  115. -- rect: left=209 top=218 right=250 bottom=331
  116. -- title width / last selected line: 0
  117. -- icon id / first selected line: 0 / 0
  118. -- text alignment: 1
  119. -- font id: 0
  120. -- text size: 12
  121. -- style flags: 0
  122. -- line height: 16
  123. -- part name: Example 1
  124. ----- HyperTalk script -----
  125. on mouseUp
  126.   if the optionkey is down then
  127.     ask "what do you want to name this button?"
  128.     if it is empty then
  129.       beep
  130.     else
  131.       set the name of the target to it
  132.     end if
  133.   else
  134.     --
  135.     --your normal mouseup script goes in here
  136.     --
  137.   end if
  138. end mouseUp
  139.  
  140.  
  141.  
  142. -- part 11 (button)
  143. -- low flags: 00
  144. -- high flags: A003
  145. -- rect: left=355 top=255 right=307 bottom=422
  146. -- title width / last selected line: 0
  147. -- icon id / first selected line: 21240 / 21240
  148. -- text alignment: 1
  149. -- font id: 0
  150. -- text size: 12
  151. -- style flags: 0
  152. -- line height: 16
  153. -- part name: Example 1
  154. ----- HyperTalk script -----
  155. on mouseUp
  156.   if the optionkey is down then
  157.     ask "what do you want to name this button?"
  158.     if it is empty then
  159.       beep
  160.     else
  161.       set the name of the target to it
  162.     end if
  163.   else
  164.     --
  165.     --your normal mouseup script goes in here
  166.     --
  167.   end if
  168. end mouseUp
  169.  
  170.  
  171.  
  172. -- part 12 (button)
  173. -- low flags: 00
  174. -- high flags: A005
  175. -- rect: left=337 top=218 right=250 bottom=459
  176. -- title width / last selected line: 0
  177. -- icon id / first selected line: 21240 / 21240
  178. -- text alignment: 1
  179. -- font id: 0
  180. -- text size: 12
  181. -- style flags: 0
  182. -- line height: 16
  183. -- part name: Example 1
  184. ----- HyperTalk script -----
  185. on mouseUp
  186.   if the optionkey is down then
  187.     ask "what do you want to name this button?"
  188.     if it is empty then
  189.       beep
  190.     else
  191.       set the name of the target to it
  192.     end if
  193.   else
  194.     --
  195.     --your normal mouseup script goes in here
  196.     --
  197.   end if
  198. end mouseUp
  199.  
  200.  
  201.  
  202. -- part contents for background part 5
  203. ----- text -----
  204. 2
  205.  
  206. -- part contents for background part 12
  207. ----- text -----
  208. Self Naming Button
  209.  
  210. -- part contents for card part 1
  211. ----- text -----
  212. When you click on this button with the option key held down, you will be asked to rename it.  This will allow your users to rename buttons without knowing anything about Hypercard (example 1).  Another way to do this will be to check if the button currently has a name, and allow the user to rename it if it doesn't (such as the Sound Studio stack uses.)
  213.